<?php
  include("include/conn.php");
  require('include/Smarty/libs/Smarty.class.php');
  
  $partyIdCount = "";
  $partyId      = "";
  $partyName    = "";
  $msg = "";
  $i = 0;
  $selectQuerypartyName = "SELECT partyId,partyName 
                             FROM party
                            ORDER BY partyName  DESC";
  $selectQuerypartyNameResult = mysql_query($selectQuerypartyName);
  $partyNameRow = mysql_num_rows($selectQuerypartyNameResult);
  if($partyNameRow > 0)
  {
    while($partyNameRow = mysql_fetch_array($selectQuerypartyNameResult))
    {
      $partyIdCount        .= $partyNameRow['partyId'].",";
      $partyId[$i]          = $partyNameRow['partyId'];
      $partyName[$i]        = $partyNameRow['partyName'];
      $i++;
    }
  }
  else
  {
    $msg = "<center><div class='clean-gray'>Party Not Found ...!!!</div></center>";
  }
  $smarty = new Smarty;
  require('bottom.php');
  $smarty->assign("l_listParty",$l_listParty);
  $smarty->assign("l_partyName",$l_partyName);

  $smarty->assign("i",$i);
  $smarty->assign("msg",$msg);
  $smarty->assign("partyIdCount",$partyIdCount);
  $smarty->assign("partyId",$partyId);
  $smarty->assign("partyName",$partyName);
  $smarty->display('partyList.tpl');
?>
